// 定义异常类型映射
export const ANOMALY_TYPE_MAP: Record<number, "red" | "yellow" | "green"> = {
  30: "red",    // 报警
  20: "yellow", // 预警
  0: "green"    // 正常
};

export const ANOMALY_NAME_TYPE_MAP: Record<number, string> = {
  30: "报警",    // 报警
  20: "预警", // 预警
  10: "正常"    // 正常
};
/**
 * 根据评估项目的分组类型和当前状态确定异常类型
 * @param currentState 当前状态
 * @returns 异常类型 ("red" | "yellow" | "green" | "gray")
 */
export const getAnomalyType = (currentState: number): "red" | "yellow" | "green" | "gray" => {
  return ANOMALY_TYPE_MAP[currentState] || "green";
};

export const getAnomalyName = (currentState: number): string => {
  console.log("currentState", currentState);
  return ANOMALY_NAME_TYPE_MAP[currentState] || "";
};